$(function() {
	var doc = $(document),
		body = $('body'),
		sideContent = body.find('.side-content'),
		preview = body.find('.preview');
	
		$.widget("MQM.preview", {

			_create: function () {
				var self = this,
					e = self.element;
					
				self.seeds = {};
				e.html(template("preview-tmpl"));
				console.log(template("preview-tmpl"));
			},
			
			addSeed: function (seed) {
				var self = this,
					e = self.element;
				
				if (self.seeds[seed.id]) {
				
				} else {
					seed.genPreviewHtml(e, sideContent);
					self.seeds[seed.id] = seed;
				}
			}
			
		});
		
		$.widget("MQM.questionSeed", {
			
			options: {
				seed: null
			},
			
			_create: function () {
				var self = this,
					e = self.element,
					o = self.options;
					
				e.html(seed.genPreviewHtml());
			},
			
			get: function () {
				var self = this,
					o = self.options;
					
				return o.seed;
			}
			
		});
		
		preview.preview();
});